<template>
    <view>
		
        <view class="container_2">
            <view :class="scrollTop > 85 ? 'header_2_fixed' : 'header_2'">
                按
                <text style="color: blue">{{ jobinfo.jobtitle }}</text>
                职位共匹配
                <text style="color: red">{{ notecount }}个</text>
                简历
            </view>

            <!-- 列表 -->
            <view class="news">
                <view class="newslist" v-for="(item, index) in notelist" :key="index">
                    <view class="title" @tap="toWorkerDetail" :data-id="item.id">
                        <view class="detail">
                            <view class="info">
                                <view>{{ item.name }}</view>
                                <view>{{ item.sex == 1 ? '男' : '女' }} / {{ item.age }}岁 / {{ item.education }} / {{ item.express }}</view>
                                <view class="jobmoney">
                                    意向职位:
                                    <text>{{ item.jobtitle }}</text>
                                </view>
                            </view>

                            <view class="pic">
                                <image :src="item.avatarUrl"></image>

                                <text class="time">{{ item.refreshtime }}</text>

                                <image :src="'../../imgs/icon/' + (item.sex == 1 ? 'man' : 'sex') + '.png'" class="footimg" style="width: 30rpx; height: 30rpx"></image>
                            </view>
                        </view>
                    </view>
                </view>

                <view class="logincompany" v-if="companyid == 0">
                    <view>成为企业会员，高效挑选人才!</view>

                    <view><button @tap="toLogin">登录企业</button></view>
                    <view @tap="doCall" :data-tel="intro.tel">客服服务热线:{{ intro.tel }}</view>
                </view>
            </view>
        </view>

        <!-- 加载更多 -->
        <view class="loadmore">
            <text>{{ loadMore }}</text>
        </view>

        <view class="u-tap-btn">
            <button class="u-go-home2" open-type="contact">
                <view class="iconfont fa fa-comments-o"></view>
            </button>
        </view>
    </view>
</template>

<script>
import { Note } from '../findworker/note-model.js';
var note = new Note(); //实例化 首页 对象
export default {
    data() {
        return {
            city: uni.getStorageSync('companyinfo').city,
            isCars: true,

            // 选择车源开关
            isSort: true,

            // 选择排序开关
            isArea: true,

            isCate: true,
            isEdu: true,

            // 选择价格开关
            isType: true,

            isSelect: true,
            loadMore: '',
            list: [],
            house_list: [],
            housetypelist: [],
            houseareaid: 0,
            housepriceid: 0,
            housetype: 0,
            letway: 0,
            page: 1,
            title: '',
            jobid: 0,
            notelist: '',
            notecount: '',

            jobinfo: {
                jobtitle: ''
            },

            isPrice: false,
            scrollTop: 0,
            companyid: 0,

            intro: {
                tel: ''
            }
        };
    }
    /**
     * 生命周期函数--监听页面加载
     */,
    onLoad: function (e) {
		console.log('进入页面')
        var that = this;
        that.jobid = e.id;
        uni.setNavigationBarTitle({
            title: '匹配简历'
        });
        var cityinfo = uni.getStorageSync('cityinfo');
        console.log('城市内容',cityinfo);
        if (cityinfo) {
            uni.setStorageSync('city', cityinfo.name);
            that.setData({
                city: uni.getStorageSync('cityinfo').name
            });
        }
        var cityid = uni.getStorageSync('cityinfo').id;
        var params = {
            cityid: cityid,
            jobid: that.jobid
        };
        console.log(params);
        note.getMatchNoteListData((data) => {
            console.log(data);
            that.setData({
                notelist: data.notelist,
                notecount: data.notecount,
                jobinfo: data.jobinfo
            });
        }, params);
    },
    /**
     * 生命周期函数--监听页面初次渲染完成
     */
    onReady: function () {},
    /**
     * 生命周期函数--监听页面隐藏
     */
    onHide: function () {},
    /**
     * 生命周期函数--监听页面卸载
     */
    onUnload: function () {},
    /**
     * 页面相关事件处理函数--监听用户下拉动作
     */
    onPullDownRefresh: function () {},
    /**
     * 页面上拉触底事件的处理函数
     */
    onReachBottom: function () {},
    /**
     * 用户点击右上角分享
     */
    onShareAppMessage: function () {},
    methods: {
        toWorkerDetail: function (e) {
            var id = e.currentTarget.dataset.id;
            uni.navigateTo({
                url: '/pages/workerdetail/index?id=' + id
            });
        },

        selectCars: function (e) {
            var that = this;
            that.setData({
                isSort: true,
                isPrice: true,
                isType: true,
                isSelect: true,
                isCars: !that.isCars
            });
        },

        selectPrice: function () {
            var that = this;
            that.setData({
                isSort: true,
                isCars: true,
                isType: true,
                isPrice: !that.isPrice
            });
        },

        selectType: function () {
            var that = this;
            that.setData({
                isSort: true,
                isCars: true,
                isPrice: true,
                isType: !that.isType
            });
        },

        selectSort: function () {
            var that = this;
            that.setData({
                isCars: true,
                isPrice: true,
                isType: true,
                isSort: !that.isSort
            });
        },

        selectWay: function () {
            var that = this;
            that.setData({
                isSort: true,
                isCars: true,
                isPrice: true,
                isType: true,
                isSelect: !that.isSelect
            });
        },

        toLogin() {
            console.log('占位：函数 toLogin 未声明');
        },

        doCall() {
            console.log('占位：函数 doCall 未声明');
        }
    }
};
</script>
<style>
/* search */
/**app.wxss**/
page {
    background-size: 100% 100%;
    height: 100%;
    font-size: 32rpx;
    font-family: '微软雅黑', '方正黑体';
    color: #333;
    background: #f5f5f5;
}

.container_2 {
    background-color: #f0f1f5;
    min-height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.header_2 {
    width: 720rpx;
    display: flex;
    flex-direction: row;
    justify-content: flex-start;
    padding-top: 30rpx;
    padding-bottom: 30rpx;
    background: #fff;
    padding-left: 20rpx;
}
.header_2_fixed {
    width: 720rpx;
    display: flex;
    flex-direction: row;
    justify-content: flex-start;
    padding-top: 30rpx;
    padding-bottom: 30rpx;
    background: #fff;
    position: fixed;
    z-index: 100;
    top: 0px;
    padding-left: 20rpx;
}

.city_2 {
    height: 80rpx;
    line-height: 80rpx;
    color: #000000;
    font-size: 0.9rem;
    font-weight: 600;
}
.search_2 {
    width: 500rpx;
    height: 80rpx;
    line-height: 80rpx;
    background: #f0f1f5;
    display: flex;
    flex-direction: row;
    justify-content: center;
    border-radius: 30rpx 30rpx 30rpx 0rpx;
}
.search_2 view {
    color: #a6a6a6;
    font-size: 0.7rem;
    align-self: center;
}
.search_2 icon {
    margin-right: 20rpx;
    margin-top: 18rpx;
}

.selectcars {
    width: 100%;
    display: flex;
    flex-direction: row;
    justify-content: flex-start;
    padding: 20rpx;
    font-size: 0.8rem;
    background: #ffffff;
}
.selectcars_fixed {
    width: 100%;
    display: flex;
    flex-direction: row;
    justify-content: flex-start;
    padding: 20rpx;
    font-size: 0.8rem;

    z-index: 1112;
    position: fixed;
    top: 120rpx;
    background: #fff;
}

.itemselectcars {
    display: flex;
    flex-direction: row;
    height: 60rpx;
    justify-content: center;
    align-items: center;
    width: 24%;
}

.itemselectcars image {
    width: 15rpx;
    height: 15rpx;
    align-self: center;
    margin-left: 5rpx;
}

.red {
    color: #fd6a36;
}

.select_cars,
.select_sort,
.select_price {
    position: fixed;
    top: 90px;
    left: 0px;
    z-index: 888;
    width: 100%;
    padding-left: 30rpx;

    background-color: #fff;
}

.select_cars text,
.select_sort text {
    display: block;
    flex: 1;
    line-height: 35px;
    font-size: 13px;
}

.select_cars text:last-child,
.select_sort text:last-child {
    border-bottom: 0;
}

.select_cars_list {
    display: flex;
    border-bottom: 1px solid #ececec;
}

.select_cars_list image {
    width: 12px;
    height: 22px;
    padding-top: 8px;
    margin-right: 30rpx;
}
.select {
    border-bottom: 1px solid #e62129;
}

.select text {
    color: #e62129;
}

.select_price {
    display: flex;
    flex-direction: row;
    justify-content: center;
    flex-wrap: wrap;
    padding: 6px 4%;
    padding-top: 30rpx;
}
.select_price .item {
    height: 80rpx;
    background: #f3f3f3;
    padding-left: 15rpx;
    padding-right: 15rpx;
    border-radius: 35rpx;
    margin-right: 22rpx;
    margin-bottom: 20rpx;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 12px;
}

/* 遮罩层 */
.small_overlay {
    position: fixed;
    width: 100%;
    height: 80%;
    bottom: 0;
    left: 0;
    z-index: 666;
    background-color: rgba(0, 0, 0, 0.5);
}

.loadmore {
    line-height: 35px;
    font-size: 15px;
    text-align: center;
}
.makebutton {
    display: flex;
    width: 100%;
    flex-direction: row;
    justify-content: center;
}
.makebutton button {
    background: #e62129;
    color: #fff;
    width: 260rpx;
    height: 70rpx;
    line-height: 70rpx;
    font-size: 0.7rem;
    align-self: center;
}

.news {
    margin-top: 10rpx;
    width: 100%;
    display: flex;
    flex-direction: column;
}
.news .newstitle {
    width: 100%;
    height: 80rpx;
    line-height: 80rpx;
    margin-left: 20rpx;
    font-size: 0.7rem;
    border-bottom: 1rpx solid #efefef;
    margin: 0 auto;
    display: flex;
    flex-direction: row;
    align-content: center;
}

.news .newstitle view:nth-child(1) {
    height: 40rpx;
    line-height: 40rpx;
    width: 6rpx;
    background: #3274e5;
    align-self: center;
    margin-left: 10rpx;
}
.news .newstitle view:nth-child(2) {
    height: 80rpx;
    line-height: 80rpx;
    width: 150rpx;
    padding-left: 15rpx;
}

.news .newslist {
    display: flex;
    flex-direction: row;
    width: 720rpx;
    margin: 0 auto;
    padding: 20rpx;
    margin-bottom: 20rpx;
    background: #fff;
}

.news .newslist .title {
    width: 100%;
    flex-direction: column;
    display: flex;
    justify-content: space-between;
}

.news .newslist .title .detail {
    padding-left: 2%;
    text-align: left;
    font-size: 0.8rem;
    color: #000;
    display: flex;
    flex-direction: row;
    width: 100%;
}

.news .newslist .title .detail .pic {
    width: 20%;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
}

.news .newslist .title .detail .pic image {
    width: 120rpx;
    height: 120rpx;
    align-self: center;
    border-radius: 60rpx;
}
.news .newslist .title .detail .pic text {
    font-size: 10px;
    color: #646464;
}

.footimg {
    width: 40rpx;
    height: 40rpx;
    position: absolute;
    left: 120rpx;
    right: 0;
    top: 80rpx;
}

.news .newslist .title .detail .info {
    width: 75%;
}

.news .newslist .title .detail .info view:nth-child(1) {
    padding-top: 10rpx;
    color: #000;
    font-weight: bold;
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    font-size: 15px;
}

.news .newslist .title .detail .info view:nth-child(2) {
    padding-top: 10rpx;
    padding-bottom: 10rpx;
    color: #646464;
    font-size: 12px;
}

.news .newslist .title .detail view:nth-child(3) {
    padding-top: 10rpx;
    padding-right: 10rpx;
}
.news .newslist .title .price {
    width: 28%;
}

.news .newslist .title .price .money {
    color: #d65408;
    font-weight: bold;
    font-size: 0.7rem;
    padding-right: 10rpx;
}

.jobname > text {
    color: #b7b7b7;
}
.jobmoney {
    display: flex;
    flex-direction: row;
    justify-content: flex-start;
    color: #646464;
    font-size: 13px;
}

.jobmoney text {
    color: #1296db;
    margin-left: 10rpx;
}
.info .time {
    color: #ff4129;
    font-size: 0.7rem;
}

/*begin 案例*/
.case {
    margin-top: 10rpx;
    width: 100%;
    background: #fff;
    display: flex;
    flex-direction: column;
}
.case .casetitle {
    width: 100%;
    height: 80rpx;
    line-height: 80rpx;
    margin-left: 20rpx;
    font-size: 0.7rem;
    border-bottom: 1rpx solid #efefef;
    margin: 0 auto;
    display: flex;
    flex-direction: row;
    align-content: center;
}
.case .casetitle view:nth-child(1) {
    height: 40rpx;
    line-height: 40rpx;
    width: 6rpx;
    background: red;
    align-self: center;
}
.case .casetitle view:nth-child(2) {
    height: 80rpx;
    line-height: 80rpx;
    width: 150rpx;
    padding-left: 15rpx;
}
.case .caselist {
    display: flex;
    flex-direction: row;
    width: 100%;
    margin: 0 auto;
    padding-top: 10rpx;
    padding-bottom: 10rpx;
    flex-wrap: wrap;
}
.case .caselist .caseitem {
    width: 50%;
    display: flex;
    flex-direction: column;
    margin-bottom: 20rpx;
}
.case .caselist .caseitem .pic {
    height: 220rpx;
    line-height: 220rpx;
    align-items: center;
    justify-content: center;
    display: flex;
}
.case .caselist .caseitem .pic image {
    width: 320rpx;
    height: 220rpx;
}

.case .caselist .caseitem .title {
    height: 40rpx;
    line-height: 40rpx;
    font-size: 0.7rem;
    padding-top: 10rpx;
    color: #3e3e3e;
    padding-left: 40rpx;
}

.case .content {
    font-size: 0.8rem;
    padding: 20rpx;
    text-indent: 50rpx;
    color: #6a6a6a;
}

.logincompany {
    width: 100%;
    background: #fff;
    height: 500rpx;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}
.logincompany view:nth-child(1) {
    font-weight: bold;
    font-size: 16px;
    color: #000;
}

.logincompany button {
    background: #07b56d;
    font-size: 14px;
    color: #fff;
    width: 250rpx;
    height: 80rpx;
    border-radius: 15rpx;
    margin-top: 30rpx;
}
.logincompany view:nth-child(3) {
    color: #a2a2a2;
    font-size: 14px;
    margin-top: 30rpx;
}
button::after {
    border: 0;
}
/*end 案例*/
</style>
